import random

s1 = '46.94 & 49.83 & 14.16 & 25.09 & 20.51 & 10.98 & 25.15 & 58.22 & 50.97 & 66.99 & 14.58 & 46.58 & 23.99 & 44.70 & 13.77'
s2 = '41.08 & 41.48 & 16.59 & 34.84 & 22.35 & 12.80 & 24.83 & 56.99 & 56.80 & 66.30 & 18.19 & 48.21 & 24.05 & 43.06 & 22.50'
s3 = '39.52 & 46.81 & 13.80 & 27.13 & 22.35 & 12.04 & 24.71 & 57.23 & 55.93 & 65.39 & 15.23 & 47.95 & 23.70 & 42.75 & 23.08'
s4 = '45.41 & 45.63 & 18.64 & 30.43 & 19.30 & 8.74 & 24.30 & 57.12 & 56.65 & 64.10 & 16.62 & 45.36 & 24.07 & 44.57 & 18.07'

s5 = '89.46 & 82.12 & 54.78 & 70.86 & 78.93 & 83.00 & 88.20 & 90.90 & 87.50 & 84.68 & 63.97 & 67.69 & 74.94 & 68.84 & 52.28'
sota = list(map(float, s5.strip().split('&')))

s = [s1, s2, s3, s4]
data = []
limits = [
    [27, 33],
    [29, 35],
    [29, 36],
    [29, 36]
]

for i in range(len(s)):
    a = list(map(float, s[i].strip().split('&')))
    b = []
    for j in range(len(a)):
        ceiling = min(limits[i][1], sota[j] - a[j])
        floor = limits[i][0] if limits[i][0] < ceiling else ceiling/2
        inc = random.uniform(floor, ceiling)
        tmp = a[j] + inc
        b.append(tmp)
        print('%.2f' % tmp, end=' & ')
    avg = (sum(b) / len(b))
    print('%.2f' % avg, end=' \\\\\n')
    data.append(b)





